package com.exp.service;

import com.exp.dao.BusinessMapper;
import com.exp.dao.more.MoreBusinessMapper;
import com.exp.model.Business;
import com.exp.model.HotBusiness;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by guojianyu on 2015/9/11.
 */
@Service
@Transactional
public class BusinessService {
    @Autowired
    private MoreBusinessMapper moreBusinessMapper;
    @Autowired
    private BusinessMapper businessMapper;
    /*管理员获取商家总列表*/
    public List<Business> getListAll(Map map) {
        return moreBusinessMapper.getListAll(map);
    }
    /*商家获取列表*/
    public List<Business> getList(Map map) {
        return moreBusinessMapper.getList(map);
    }
    /*注册商家*/
    public int add(Business business){
        return  businessMapper.insert(business);
    }
    /*商家登录*/
    public List<Business> businessLogin(Map map){
        List<Business> list=moreBusinessMapper.businessLogin(map);
        return list;
    }
 /*   public Business businessLogin(Map map){
        Business business=moreBusinessMapper.businessLogin(map);
        return business;
    }*/
    /*更改商家审核状态*/
    public int enabled(Business business) {
        return businessMapper.updateByPrimaryKeySelective(business);
    }

    public int disabled(Business business){
        return businessMapper.updateByPrimaryKeySelective(business);
    }
    /*修改*/
    public int update(Business business){
        return  businessMapper.updateByPrimaryKeySelective(business);
    }
}
